package utilsJ2ME.listas;

import interfazUsuario.botones.BotonAbstract;

public class ListaBotonJ2ME {
	BotonAbstract[] list=new BotonAbstract[0];

	public void add(BotonAbstract arg0) {
		// TODO Auto-generated method stub
		BotonAbstract[] aux= new BotonAbstract[list.length+1];
		for(int i=0;i<list.length;i++){
			aux[i]=list[i];
		}
		arg0.setId(list.length);
		aux[list.length]=arg0;
		list=aux;
	}

	public BotonAbstract get(int arg0) {
		// TODO Auto-generated method stub
		return list[arg0];
	}

	public int length() {
		// TODO Auto-generated method stub
		return list.length;
	}
	
	public BotonAbstract getSelectedBoton(int id){
		if (id>=0&&id<list.length){
			return list[id];
		}else{
			return null;
		}
	}
}
